using System;
using System.Collections.ObjectModel;
using SydEnergiPrototype.DataRepositoryServiceRef;

namespace SydEnergiPrototypeUnitTest.DataAccessTest
{
    public class DataRepositoryClientMock : IDataRepositoryService
    {
        public bool BeginGetCabinetsWasCalled = false;
        public bool EndGetCabinetsWasCalled = false;
        public bool BeginSetCabinetsWasCalled = false;
        public bool EndSetCabinetsWasCalled = false;

        public IAsyncResult BeginGetCabinets(AsyncCallback callback, object asyncState)
        {
            BeginGetCabinetsWasCalled = true;
            return new AsyncResultMock();
        }

        public ObservableCollection<CabinetDto> EndGetCabinets(IAsyncResult result)
        {
            EndGetCabinetsWasCalled = true;
            return new ObservableCollection<CabinetDto>();
        }

        public IAsyncResult BeginSetCabinets(ObservableCollection<CabinetDto> cabinets, AsyncCallback callback, object asyncState)
        {
            BeginSetCabinetsWasCalled = true;
            return new AsyncResultMock();
        }

        public void EndSetCabinets(IAsyncResult result)
        {
            EndSetCabinetsWasCalled = true;
        }
    }
}